import request from '@/router/axios';

// 获取列表
export const getCtopicinfoList = (current, size, params) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getTopicNo = () => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/getCtopicNo',
    method: 'get'
  })
}
export const getLastMeet = () => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/getLastCtopic',
    method: 'get'
  })
}

// 保存
export const save = (data) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/save',
    method: 'post',
    data: data
  })
}
// 删除
export const remove = (ids) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

//查看
export const getDetail = (id) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 会议纪要议题列表
export const getMeetingAgendaList = (current, size, params,ctopicNo) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/meetingAgendaList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      ctopicNo
    }
  })
}

// 保存总体纪要
export const saveOverAllMinute = (data) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/saveOverAllMinute',
    method: 'post',
    data: data
  })
}

// 会议总体纪要详情
export const overAllMinuteDetail = (ctopicNo) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/overAllMinuteDetail',
    method: 'get',
    params: {
      ctopicNo
    }
  })
}

// 议题纪要详情
export const ftopicMinuteDetail = (ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/ftopicMinuteDetail',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo
    }
  })
}

// 保存议题纪要
export const saveFtopicMinute = (data) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/saveFtopicMinute',
    method: 'post',
    data: data
  })
}

// 更改议题是否上下次会
export const updateFtopicIsNext = (data) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/updateFtopicIsNext',
    method: 'get',
    params: data
  })
}

// 发布会议纪要
export const publishMinute = (ctopicNo) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/publishMinute',
    method: 'get',
    params: {
      ctopicNo
    }
  })
}

// 议题撤回
export const withdraw = (ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/withdraw',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo
    }
  })
}
// 获取某部门下人员
export const getList = (params, deptId) => {
  return request({
    url: '/api/blade-system/personnelinfo/getUsers',
    method: 'get',
    params: {
      ...params,
      deptId,
    }
  })
}
